import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: () => import('../views/index.vue'),
      redirect: '/main',
      children: [
        {
          path: "/main",
          name: "main",
          meta: {
            title: "主页",
            showSidebar: true
          },
          component: () => import("../views/main/index.vue"),
        },
        {
          path: "/vue2",
          name: "vue2",
          meta: {
            title: "vue2应用",
            showSidebar: true
          },
          component: () => import("../views/main/vue2.vue"),
        },
        {
          path: "/vue3",
          name: "vue3",
          meta: {
            title: "vue3应用",
            showSidebar: true
          },
          component: () => import("../views/main/vue3.vue"),
        },
      ]
    }
   
  ]
})

export default router
